package router

import (
	"github.com/gin-gonic/gin"
	"github.com/smash-llj/Nexa-server/api"
)

func InitUserRoutes() {
	//注册当前大模块到gfnRoutes里面
	RegisterRoute(func(rgPublic *gin.RouterGroup, tgAuth *gin.RouterGroup) {
		userApi := api.NewUserApi()
		userPublicUserRouter(rgPublic, userApi)
		userPrivateUserRouter(tgAuth, userApi)
	})
}

func userPrivateUserRouter(private *gin.RouterGroup, api api.UserApi) {
	private.POST("/updateInfo", api.UpdateUserInfo)
}

func userPublicUserRouter(public *gin.RouterGroup, api api.UserApi) {
	public.POST("/login", api.Login)
	public.POST("/register", api.Register)
}
